home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
426-450
/
disk_438
/
menuc
/
docs
/
menuc8.doc
< prev
next >
Wrap
Text File
|
1992-05-06
|
12KB
|
387 lines
MenuC
The Menu Compiler
Written by Bruce Mackey
(c) 1990,1991
All Rights Reserved.
Version 0.8
-== INCLUDES DOCUMENTATION FOR GADGET SUPPORT ==-
-== SEARCH FOR '###' to find whats New ==-
DISCLAIMER
Anyone my FREELY distribute this program and program
documentation, providing that the program, documentation, and LZH
file remain in there original state. You as the user or distributor
may not charge any money apart from postage or material (eg. Disks).
If you want to bundle this program (oh sure) with some work of
your own you MUST get permission from the author in writing (of course
if it is for a commercial product the author would like some green
backs...er CASH!). addendum: should you use this program in the
development of a larger program: as author of MenuC I request that;
(1) if the program is for the public domain:
please acknowledge 'MenuC'
(2) if the author of the program requests/requires that money be paid
for ownership or for using said progam:
please acknowledge 'MenuC' in a VERY BIG way and give a free
copy or free use of said program to the author of 'MenuC'. :) :)
As the author of MenuC I do not make any claims of copyright for
files produced by MenuC. No guarantees implied or explicate are given.
OVERVIEW
MenuC was created because I am sick and tied of keying in
all the information needed to create just one menu, let alone
FIVE! MenuC will take a VERY SIMPLE ascii file and create those
VERY finger intensive MENU, MENUITEM (SUBITEM), and IntuiText
structures needed for a complete menu.
Support for GADGET,BORDER,PROPINFO,STRINGINFO and USHORT arrays
needed for working gadgets was the next logical step.
NOTE: MenuC deals ONLY with TEXT menus/gadgets, no graphics/images.
### Gadgets created will have the WB2.0 raised look.
SPECIFICS
MenuC is called from the command line with the following
format:
### MenuC infile outfile [LASM|ASM] [TEST] [INFO]
infile and outfile are self exploratory.
LASM - causes the program to produce an assembler output file
compatible with Lattice's `asm'.
ASM - causes the program to produce an assembler output file
compatible with MetaComCo's `assem'.
TEST - will cause the program to add a 'C' main() at the end
of the output file OR an assembler startup routine at
the start of the output file. The resulting outfile can
be compiled/assembled as a stand-alone program in order
to view your menus. Scripts s/MC, s/MCLAsm, s/MCAsm are
supplied for making MenuC easier to use.
### INFO - providing no errors occurred MenuC will display a total of
specific structures that it wrote to the output file.
INFO DOES NOT report everything MenuC writes to the file.
NOTE: Output produced by LASM and ASM flags will work with A68k.
MenuC is in the second stage of development. Currently it
recognizes twelve (12) keywords which are as follows:
WIDTH - right now it is used only for the main() routine
created with the TEST flag from the CLI. Future
versions will have error checking for screen
width
MENU - defines the actual menu
ITEM - defines the menu's item
SUBITEM - defines an item's subitem
SHORTCUT - defines a keyboard shortcut for an item or
subitem
### BOOL - defines a BOOLGADGET
### STRING - defines a STRGADGET
### PROP - defines a PROPGADGET
### GIMMEZZ - declares the gadget for use with a GIMMEZEROZERO window
### REQUEST - declares the gadget for use with a REQUESTER
### LONGINT - defines a STRINGADGET that accepts only numeric data
### BORDER - defines border type ( 1.3 or 2.0 )
Keywords can be either upper or lower case and can have white
space in front of them (for the structured look).
KEYWORD SYNTAX
WIDTH size (DEFAULT: 640)
WIDTH MUST be on the first line of the file and
can have a value of 320 or 640. This will
MAY change when WB2.0 is more widely available.
MENU menu# NAME
menu# has a range of 1 - n.
NAME can be a quoted string (see DRAWBACKS below).
ITEM menu# item# NAME [SHORTCUT c]
menu# and item# have a range of 1 - n.
menu# MUST be a valid menu number since ITEM will be
bound to the MENU that owns menu#.
NAME can be a quoted string (see DRAWBACKS below).
The 'c' in [SHORTCUT c] can be any printable character
either upper or lower case.
SUBITEM menu# item# subitem# NAME [SHORTCUT c]
same description as ITEM with this exception:
if you have a definition like this:
ITEM 1 1 OPEN SHORTCUT O
SUBITEM 1 1 1 Documents SHORTCUT D
The ITEM's SHORTCUT will be ignored.
### ------- its not as bad as it looks. take a look at the examples.
### BOOL [subgadget] NAME llll,tttt wwww,hhhh FLAGS ACTIVATION [GadID]
### STRING [subgadget] NAME llll,tttt wwww,hhhh FLAGS ACTIVATION [GadID]
### PROP [subgadget] NAME llll,tttt wwww,hhhh FLAGS ACTIVATION [GadID]
### LONGINT [subgadget] NAME llll,tttt wwww,hhhh FLAGS ACTIVATION [GadID]
subgadget can be GIMMEZZ and REQUEST
using GIMMEZZ with TEST on the command line will cause
the test program to create a GIMMEZEROZERO window.
NAME can be a quoted string (see DRAWBACKS below).
llll is the leftedge of the gadget in base 10
tttt is the topedge of the gadget in base 10
wwww is the width of the gadget in base 10
hhhh is the height of the gadget in base 10
FLAGS and ACTIVATION:
I tried to make this as easy as possible for the user
and myself for coding reasons, so I am using the same
method as the Basic that is shipped with your Amiga.
The method is that each flag is assigned a value and
by adding the values together you get the desired flags
for the gadget.
Below is the list of flags and there values.
If all else fails turn to pages 93-94 of the
revised RKM libs & devs manual, the values
are in the same order that the flags are listed
1,2,4,8,16,32,etc.
flags:
GADGHCOMP 1
GADGHBOX 2
GADGHIMAGE 4 ;not supported yet
GADGHNONE 8
GADGIMAGE 16 ;not supported yet
GRELBOTTOM 32
GRELRIGHT 64
GRELWIDTH 128
GRELHEIGHT 256
SELECTED 512
GADGDISABLED 1024
activation:
TOGGLESELECT 1
GADGIMMEDIATE 2
RELVERIFY 4
ENDGADGERT 8
FOLLOWMOUSE 16
RIGHTBORDER 32
LEFTBORDER 64
TOPBORDER 128
BOTTOMBORDER 256
STRINGCENTER 512
STRINGRIGHT 1024
LONGINT 2048 ;USE LONGINT as GADGETTYPE
ALTKEYMAP 4096 ;not supported yet
BOOLEXTEND 8192 ;not supported yet
example:
BOOL GIMMEZZ test 10,180 100,9 1025 5
1025 = GADGHCOMP | GADGDISABLED
5 = TOGGLESELECT | RELVERIFY
MenuC tries to be as intelligent as possible when it comes
to the FLAGS and ACTIVATION fields. Meaning that MenuC WILL
NOT allow flags that in MenuC's opinion conflict with each other.
Unfortunately, if you don't agree with my choices of exclusion
you'll have to go back into the outfile and manually change them.
MenuC just trims the flags so the gadget will work...no more.
(see DRAWBACKS below)
define a gadget with FLAGS = 2047 & ACTIVATION = 16383
this will show most of the conflicts.
(see examples/conflicts.men)
you'll see that MenuC WILL create a Gadget, and that
the gadget's FLAGS & ACTIVATION fields are modified
to allow the gadget to work correctly.
GadID will allow you to number the gadgets as you see fit.
OR
MenuC will automatically keep track of each gadget's
GadgetID number. If you have 5 gadgets:
BOOL test1 10,10 20,20 1 3 1025
BOOL test2 35,10 20,20 1 3 ; ID = 1026
BOOL test3 55,10 20,20 1 3 3
BOOL test4 80,10 20,20 1 3 ; ID = 4
BOOL test5 105,10 20,20 1 3 ; ID = 5
gadget test1 will have an ID of 1025 and each
gadget after test1 will incremented by 1.
The last 3 will have GadIDs 3,4,5.
(the outfile will have DEFINEs/EQUs for each GadID)
If no values are specified for GadID the numbering
starts at ONE (1). If you want it to start at
ZERO (0) then assign a ZERO (0) as GadID on the
very first gadget in the source file.
### BORDER version (DEFAULT: 1.3)
version is defined as either '1.3' OR '2.0'.
I have little to no knowledge of programing in the 2.0
environment. So all that 'BORDER 2.0' will do is simply
switch the FRONTPEN and BACKPEN fields of the Border and
IntuiText structures.
DRAWBACKS
1. In version 0.8 text length is not adjusted to the longest
length of an ITEM or SUBITEM to get around this you will
have to quote NAMEs to the largest length.
eg. ITEM 1 1 "TEST "
ITEM 1 2 Documents
2. When NAMEs are quoted in version 0.8 the program (when
creating the actual structures) will insert an underscore
into all white spaces.
So if you have an ITEM's NAME define as FILE the
program will create structs like FILE_menu. If on the
other hand the ITEM's NAME is defined as "FILE " then
the structs will be created as FILE____menu, note four
underscores, one for each white space and one for _menu.
(gadget support handles names the same as described in no 2.)
3. As of this writing I don't really consider this
description as a DRAWBACK but...
The program ALWAYS adds space to the right side of an
ITEM/SUBITEM for Intuition's Command key sequence,
Right AMIGA-A commandkey.
4. In version 0.8 menus created are for HIRES screens (640-200).
The WIDTH keyword does not affect the screen width (as of yet).
### 5. there is no support for using images.
### 6. When pruning the FLAGS & ACTIVATION fields MenuC fakes intelligence,
it is possible to have a gadget on the left side of the screen
with the flag RIGHTBORDER set. This might be just want you want
but I doubt that it would be a common request. MenuC only cares
if the gadget will work (examine the gadget created from
examples/conflicts.men).
Would you like to have something added ?
Do you have ideas on improving MenuC ?
Do you have a bug report ?
Please, Contact me.
CIS: 72567,2601
BIX: bmackey
or at BBS's that I frequent:
Lion's Den: 516-399-1928
AmiAdvocat: 615-776-5438
CA-AUG: 216-642-3344
Lattice's BBS: 708-916-1200
mailing address:
Bruce Mackey
4040 Avoca Ave
Bethpage NY 11714
516-935-2075 or
516-935-5292
REVISION HISTORY
Version Revision
------- --------
0.5 initial release (6-14-90)
0.6 internal added assembler support.
added `ASM' and `LASM' command line switches.
0.7 fixed bug with improper WIDTH size.
fixed bug with erroneous SHORTCUT commands.
### 0.7.7 internal
o fixed all of the enforcer hits.
o shaved approx. 1100 bytes from the code.
o repaired some embarrassing bugs in the file
output routines.
o optimized the speed slightly.
o ADDED GADGET SUPPORT (whew!)
and the program got a little fatter and slower.
### 0.8
o added subgadgets GIMMEZZ and REQUEST
o removed redundancy in the Border output area.
MenuC will output ONLY ONE INSTANCE of like
Borders.
o added check for conflicting GADGET FLAGS
and GADGET ACTIVATION fields.
o added INFO function. (see command line)
END REVISION HISTORY
TO DO
o add an Intuition 'Point and Click' interface
constructive suggestions?
let me know. (see addresses above)
### o would anyone like to contribute support for images.
I would prefer a stand-alone program that I could
bundle with MenuC. If you already have one written
then it would require a VERY SMALL modification for
use with MenuC8.
(queue announcer)
YES, NOW YOU TOO CAN HAVE PART OF THE HEADLINES,
FAME, AND FORTUNE WITH JUST A SMALL EFFORT AND
(through an echo chamber)
!!!!!! NO MONEY DOWN !!!!!!
(applause)
(run credits) <-------- YOUR NAME HERE
SAS/C is a trademark of SAS Institute inc.
Lattice is a trademark of Lattice Incorporated.
MetaComco is a trademark of MetaComco plc.
A68k (c) Brian R. Anderson, AmigaDOS version by Charlie Gibbs.